<?php

namespace App\Models\Train\Stations;

use App\Trip\Geo\GeoManager;
use App\Trip\Geo\Location;
use App\Trip\Geo\RedisGeo;

class StationGeoManager extends GeoManager
{
    protected RedisGeo $geo;

    public function __construct()
    {
        $key       = "Train:StationGeo";
        $this->geo = new RedisGeo($key);
    }

    function addGeoByStation(TrainStation $station): void
    {
        if (!$station->location) {
            return;
        }
        $location = new Location($station->location);
        $this->addGeoByLocation($location, $station->getStationCode());
    }


}